package project.movieMap.baseLib.beans;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import lombok.*;
import java.util.HashMap;
import java.util.HashSet;

@Data
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "@class")
@JsonIgnoreProperties(ignoreUnknown = true)
public class UserDetails {
    //用户详细信息Id
    private int Id;
    //收藏的电影Id
    private HashSet<Integer> collectedMovieIds = new HashSet<>();
    //发出的评论的Id
    private HashSet<Integer> commentIds = new HashSet<>();
    //收藏的地理位置Id
    private HashSet<Integer> collectedGeoInfoIds = new HashSet<>();
    //关注的用户Id
    private HashSet<Integer> collectedUserIds = new HashSet<>();
    //用户对某个电影的评分,Integer电影Id,Float电影评分
    private HashMap<Integer,Float> rateToMovie = new HashMap<>();
    //用户对某个地方的评分,Interger位置Id,Float位置评分
    private HashMap<Integer,Float> rateToGeo = new HashMap<>();

    public void addColleMovieIds(int Id) {
        collectedMovieIds.add(Id);
    }
    public void removeColleMovieIds(int Id) {
            commentIds.remove(Id);
    }
    public void addCommentId(int id) {
        commentIds.add(id);
    }
    public void removeCommentId(int id) {
            commentIds.remove(id);
    }
    public void addRateToMovie(int movieId, float rating) {
        rateToMovie.put(movieId,rating);
    }
    public void addRateToGeo(int geoId,float rating) {
        rateToGeo.put(geoId,rating);
    }
}
